package com.duowei.diandan.bean;

import com.duowei.diandan.sql.ColumnName;
import com.duowei.diandan.sql.InsertField;
import com.duowei.diandan.sql.TableName;

import org.joda.time.LocalDateTime;

/**
 * 电子券使用明细
 */
@TableName(name = "coupon_deal_record")
public class CouponDealRecord {
    // id int(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT,

    @InsertField
    private Integer weid; // int(10) NOT NULL,
    @InsertField
    @ColumnName(name = "from_user")
    private String fromUser; // varchar(50) NOT NULL,
    @InsertField
    private Integer couponid; // int(10) NOT NULL COMMENT '优惠券id',
    @InsertField
    private LocalDateTime jysj; // datetime NOT NULL COMMENT '交易时间',
    @InsertField
    private String jylx; // varchar(200) NOT NULL COMMENT '交易类型',
    @InsertField
    private Integer sl; // int(10) NOT NULL COMMENT '交易数量',
    @InsertField
    private String syjh; // varchar(200) NOT NULL COMMENT '收银机号',
    @InsertField
    private String yhmc; // varchar(50) NOT NULL COMMENT '操作人',
    @InsertField
    @ColumnName(name = "deal_id")
    private String dealId; // varchar(50) COMMENT '注券id',
    @InsertField
    private String bmbh; // varchar(10),
    @InsertField
    private String title; // varchar(100),
    @InsertField
    private Float jyje; // decimal(10,2),
    @InsertField
    private String bz; // varchar(100),
    @InsertField
    private String yxid; // varchar(100),
    @InsertField
    private String oldcardsn; // varchar(20),
    @InsertField
    private String ordersn; // varchar(255),
    @InsertField
    private Integer uid; // int(10) DEFAULT '0'

    public CouponDealRecord() {
    }

    public Integer getWeid() {
        return weid;
    }

    public void setWeid(Integer weid) {
        this.weid = weid;
    }

    public String getFromUser() {
        return fromUser;
    }

    public void setFromUser(String fromUser) {
        this.fromUser = fromUser;
    }

    public Integer getCouponid() {
        return couponid;
    }

    public void setCouponid(Integer couponid) {
        this.couponid = couponid;
    }

    public LocalDateTime getJysj() {
        return jysj;
    }

    public void setJysj(LocalDateTime jysj) {
        this.jysj = jysj;
    }

    public String getJylx() {
        return jylx;
    }

    public void setJylx(String jylx) {
        this.jylx = jylx;
    }

    public Integer getSl() {
        return sl;
    }

    public void setSl(Integer sl) {
        this.sl = sl;
    }

    public String getSyjh() {
        return syjh;
    }

    public void setSyjh(String syjh) {
        this.syjh = syjh;
    }

    public String getYhmc() {
        return yhmc;
    }

    public void setYhmc(String yhmc) {
        this.yhmc = yhmc;
    }

    public String getDealId() {
        return dealId;
    }

    public void setDealId(String dealId) {
        this.dealId = dealId;
    }

    public String getBmbh() {
        return bmbh;
    }

    public void setBmbh(String bmbh) {
        this.bmbh = bmbh;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Float getJyje() {
        return jyje;
    }

    public void setJyje(Float jyje) {
        this.jyje = jyje;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public String getYxid() {
        return yxid;
    }

    public void setYxid(String yxid) {
        this.yxid = yxid;
    }

    public String getOldcardsn() {
        return oldcardsn;
    }

    public void setOldcardsn(String oldcardsn) {
        this.oldcardsn = oldcardsn;
    }

    public String getOrdersn() {
        return ordersn;
    }

    public void setOrdersn(String ordersn) {
        this.ordersn = ordersn;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    /**
     * @param weid
     * @param fromUser
     * @param couponId 优惠券ID
     * @param jysj     交易时间
     * @param sl       交易数量 (正负, 例：-2)
     * @param syjh     收银机号
     * @param yhmc     操作人
     * @param dealId
     * @param title    电子券名称(云会员-10元优惠券)
     * @param jyje     交易金额(正负, 例：券消费-17)
     * @param bz       备注(云会员-10元优惠券(2张))
     * @param uid
     *//*
    public CouponDealRecord(int weid, String fromUser, int couponId, String jysj, int sl, String syjh, String yhmc, String dealId, String bmbh, String title, float jyje, String bz, int uid) {
        this.weid = weid;
        this.fromUser = fromUser;
        this.couponId = couponId;
        this.jysj = jysj;
        this.sl = sl;
        this.syjh = syjh;
        this.yhmc = yhmc;
        this.dealId = dealId;
        this.bmbh = bmbh;
        this.title = title;
        this.jyje = jyje;
        this.bz = bz;
        this.uid = uid;
    }

    *//**
     * 券消费插入记录
     * 例子: <br>
     * INSERT INTO we7.coupon_deal_record (weid, from_user, couponid, jysj, jylx, sl, syjh, yhmc, deal_id, bmbh, title, jyje, bz, yxid, oldcardsn, ordersn, uid) <br>
     * VALUES (15, 'oj7T0jjAq1eh1MHL1wUkXOrZ3Rxc', 21, '2014-10-03 14:55:57', '注券', 1, 'SERVER', '管理员', null, '020', '10元抵用券', 10.00, '10元抵用券(1张)', null, null, null, null);
     * 4028522,175,o1_uLv_KDKjZb3UTnhAQSxAYh2M0,28,2017-02-23 09:58:48,券消费,-2,ZYB,罗骏,476,djnr01,云会员-10元优惠券,-17,云会员-10元优惠券(2张),,,,0
     *//*
    public String toInsertString() {
        return "INSERT INTO coupon_deal_record (    weid,          from_user,         couponid,          jysj,       jylx,        sl,          syjh,           yhmc,          deal_id,         bmbh,           title,          jyje,          bz,      yxid, oldcardsn, ordersn,  uid) " +
                "                       VALUES (" + weid + ", '" + fromUser + "', " + couponId + ", '" + jysj + "', '券消费', " + sl + ", '" + syjh + "', '" + yhmc + "', " + dealId + ", '" + bmbh + "', '" + title + "', " + jyje + ", '" + bz + "', null, null,      null, " + uid + ")|";
    }*/
}
